﻿ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="Web.Admin.Page_Role.Edit" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>

<!DOCTYPE html>

<%="<!--[if IE 8]> <html class=\"ie8 no-js\"> <![endif]-->"%>
<%="<!--[if IE 9]> <html class=\"ie9 no-js\"> <![endif]-->"%>
<%="<!--[if !IE]><!-->"%>
<html>
<%="<!--<![endif]-->"%>
    <!-- BEGIN HEAD -->

    <head>
        <meta charset="utf-8" />
        <title><%=Evan.Common.CommFun.GetAppSetting("AdminTitle") %> - 后台管理系统</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=1" name="viewport" />
        <!-- #include file="../include/com_res_css.inc" -->
    </head>
    <!-- END HEAD -->

    <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
        <!-- BEGIN HEADER -->
        
        <!-- #include file="../include/top_bar.inc" -->

        <!-- END HEADER -->
        <!-- BEGIN HEADER & CONTENT DIVIDER -->
        <div class="clearfix"> </div>
        <!-- END HEADER & CONTENT DIVIDER -->
        <!-- BEGIN CONTAINER -->
        <div class="page-container">
            <!-- BEGIN SIDEBAR -->
            
            <!-- #include file="../include/left_menu.inc" -->
            
            <!-- END SIDEBAR -->
            <!-- BEGIN CONTENT -->
            <div class="page-content-wrapper">
                <!-- BEGIN CONTENT BODY -->
                <div class="page-content">
                    <!-- BEGIN PAGE HEADER-->
                    <!-- BEGIN THEME PANEL -->
                    <!-- #include file="../include/theme_panel.inc" -->
                    <h3 class="page-title"> 角色管理</h3>
                    <!-- END PAGE TITLE-->
                    <!-- END PAGE HEADER-->
                    <!-- BEGIN PAGE CONTENT-->

                                    <div class="portlet light bordered">
                                        <div class="portlet-title tabbable-line">

                                            <div class="caption">
                                                <i class="glyphicon glyphicon-list-alt font-red"></i>
                                                <span class="caption-subject font-red bold uppercase">角色管理</span>
                                            </div>

                                        </div>
                                        <div class="tab-content">

                                            <div class="tab-pane active" id="tab_1">
                                                <div class="form">
                                                    <div class="form-horizontal form-row-seperated">
                                                        <div class="form-body">
                                                            
                                                            <%
                                                                Evan.Model.SysModel.HtmlHelperModel RoleName = new Evan.Model.SysModel.HtmlHelperModel { Title = "角色名称", PlaceHoder = "请输入角色名称", Notice = "角色名称 20字内", FieldName = "Title", FieldVerify = "notnull", MaxLength = 20, FieldType = "input"};
                                                                Evan.Model.SysModel.HtmlHelperModel IsSuperAdmin = new Evan.Model.SysModel.HtmlHelperModel { Title = "是否超级管理员", PlaceHoder = "超级管理员", Notice = "超级管理员拥有最高权限 , 可管理整个站点(包括网站栏目内容) , 不受约束", FieldName = "IsSuperAdmin", FieldVerify = "notnull", MaxLength = 20, FieldType = "switch" };
                                                                Evan.Model.SysModel.HtmlHelperModel IsSystem = new Evan.Model.SysModel.HtmlHelperModel { Title = "是否系统管理员", PlaceHoder = "系统管理员", Notice = "系统管理员可管理网站所有栏目内容 , 但没有下面的系统权限 , 需要单独授权系统权限", FieldName = "IsSystem", FieldVerify = "notnull", MaxLength = 20, FieldType = "switch" };
                                                                List<Evan.Model.SysModel.HtmlHelperModel> html = new List<Evan.Model.SysModel.HtmlHelperModel>();
                                                                html.Add(RoleName);
                                                                html.Add(IsSuperAdmin);
                                                                html.Add(IsSystem);
                                                                foreach (Evan.Model.SysModel.HtmlHelperModel item in html)
                                                                {
                                                                    Response.Write(Evan.Common.HtmlHelper.HtmlBuild(item));
                                                                }
                                                            %>
                                                            
                                                            <div class="form-group">
                                                                <label class="control-label col-md-2">系统权限</label>
                                                                <div class="col-md-6">
                                                                    <div class="clearfix">
                                                                            <div class="btn-group role_row row_0 Role-Form-Group" data-toggle="buttons" data-classid="0">
                                                                                <label class="btn btn-sm btn-default" data-rt="channel" data-classid="0">
                                                                                    <input type="checkbox" class="toggle"> 栏目管理 </label>
                                                                                <label class="btn btn-sm btn-default" data-rt="admin" data-classid="0">
                                                                                    <input type="checkbox" class="toggle"> 管理员管理 </label>
                                                                            <label class="btn btn-sm btn-default" data-rt="role" data-classid="0">
                                                                                    <input type="checkbox" class="toggle"> 权限管理 </label>
                                                                            <label class="btn btn-sm btn-default" data-rt="system" data-classid="0">
                                                                                    <input type="checkbox" class="toggle"> 系统配置 </label>
                                                                            </div>
                                                                            <div style="margin-top:5px;"></div>
                                                                            <div class="btn-group role_row row_0 Role-Form-Group" data-toggle="buttons" data-classid="0">
                                                                                <label class="btn btn-sm btn-default" data-rt="database" data-classid="0">
                                                                                        <input type="checkbox" class="toggle"> 数据库备份/还原 </label>
                                                                                <label class="btn btn-sm btn-default" data-rt="syslog" data-classid="0">
                                                                                        <input type="checkbox" class="toggle"> 操作日志 </label>
                                                                                <label class="btn btn-sm btn-default" data-rt="filemanager" data-classid="0">
                                                                                        <input type="checkbox" class="toggle"> 文件管理 </label>
                                                                                <label class="btn btn-sm btn-default" data-rt="template" data-classid="0">
                                                                                        <input type="checkbox" class="toggle"> 模板管理 </label>
                                                                            </div>

                                                                        </div>
                                                                    <span class="help-block">设置系统权限是否授权</span>    </div>
                                                            </div>

                                                            <div class="form-group hide">
                                                                <label class="control-label col-md-2">权限内容</label>
                                                                <div class="col-md-6">
                                                                    <textarea class="form-control  " field="Content" rows="5" placeholder="权限内容" field_type="textarea"></textarea>
                                                                    <span class="help-block">权限内容</span>    </div>
                                                            </div>

                                                            <div class="form-group Role-Form-Group">
                                                                <label class="control-label col-md-2">管理权限</label>
                                                                <div class="col-md-9">
                                                                    
                                                                        <table class="table table-striped table-bordered table-hover">
                                                                            <thead>
                                                                                <tr>
                                                                                    <th scope="col" class="manager_tab_center" style="width:280px">栏目</th>
                                                                                    <th scope="col" class="manager_tab_center">全选</th>
                                                                                    <th scope="col">权限</th>
                                                                                </tr>
                                                                            </thead>
                                                                            <tbody>
                                                                                
                                                                                 <%
                                                                                    Dictionary<string, string> Channel_Roles = new Dictionary<string, string>();
                                                                                    //Channel_Roles.Add("0", "顶级栏目");
                                                                                    foreach (var item in Channel_List)
                                                                                    {
                                                                                        //Channel_Roles.Add(item.Id.ToString(), Deep(item.Deep) + " " + item.Title);
                                                                                 %>
                                                                                <tr>
                                                                                    <td style="line-height:30px"><%=Deep(item.Deep) + " " + item.Title%></td>
                                                                                    <td class="manager_tab_check" style="line-height:30px"> 
                                                                                        <label class="mt-checkbox mt-checkbox-outline">
                                                                                            <input type="checkbox" class="check-one" id="check-<%=item.Id %>" data-id="<%=item.Id %>" />
                                                                                            <span></span>
                                                                                        </label>
                                                                                    </td>
                                                                                    <td>
                                                                                        <div class="clearfix">
                                                                                            <div class="btn-group role_row row_<%=item.Id %>" data-toggle="buttons" data-classid="<%=item.Id %>">
                                                                                                <label class="btn btn-sm btn-default" data-rt="view" data-classid="<%=item.Id %>">
                                                                                                    <input type="checkbox" class="toggle"> 查看 </label>
                                                                                                <label class="btn btn-sm btn-default" data-rt="add" data-classid="<%=item.Id %>">
                                                                                                    <input type="checkbox" class="toggle"> 增加 </label>
                                                                                                <label class="btn btn-sm btn-default" data-rt="delete" data-classid="<%=item.Id %>">
                                                                                                    <input type="checkbox" class="toggle"> 删除 </label>
                                                                                                <label class="btn btn-sm btn-default" data-rt="update" data-classid="<%=item.Id %>">
                                                                                                    <input type="checkbox" class="toggle"> 更新 </label>
                                                                                                <label class="btn btn-sm btn-default" data-rt="restore" data-classid="<%=item.Id %>">
                                                                                                    <input type="checkbox" class="toggle"> 回收站 </label>
                                                                                                <%--<label class="btn btn-sm btn-default hide" data-rt="verify" data-classid="<%=item.Id %>">
                                                                                                    <input type="checkbox" class="toggle"> 审核 </label>
                                                                                                <label class="btn btn-sm btn-default hide" data-rt="create" data-classid="<%=item.Id %>">
                                                                                                    <input type="checkbox" class="toggle"> 生成 </label>--%>
                                                                                            </div>
                                                                                        </div>
                                                                                    </td>
                                                                                 </tr> 
                                                                                 <%
                                                                                    }    
                                                                                 %>
                                                                                    
                                                                                    
                                                                                
                                                                               <%-- <tr>
                                                                                    <td>admin</td>
                                                                                    <td class="manager_tab_check"> 
                                                                                        <label class="mt-checkbox mt-checkbox-outline">
                                                                                            <input type="checkbox" class="check-one" id="Checkbox1" />
                                                                                            <span></span>
                                                                                        </label>
                                                                                    </td>
                                                                                    <td>张澎</td>
                                                                                    
                                                                                </tr>--%>
                                                                            </tbody>
                                                                        </table>
                                                                </div>
                                                            </div>          
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-actions form-submit-row">
                                            <div class="form-group">
                                                <label class="control-label col-md-2"></label>
                                                <div class="col-md-6">
                                                    <button type="button" class="btn btn-primary submit"><i class="fa fa-check"></i> 提交</button>
                                                </div>
                                            </div>  
                                            <div class="clear"></div>
                                        </div>

                                    </div>

                    
                    <!-- END PAGE CONTENT-->
                </div>
                <!-- END CONTENT BODY -->
            </div>
            <!-- END CONTENT -->
            
        </div>
        <!-- END CONTAINER -->
        <!-- #include file="../include/footer.inc" -->
   <!-- #include file="../include/com_res_js.inc" -->
    </body>
    
     <script  type="text/javascript">
         var model = <%=Evan.Model.ConvertModel.ConvertToJson(Model)%>;
         SetModel(model);
         var role_value = "<%= Model==null?"":Model.Content %>";
  </script>
    <script src="<%=SiteConfig.WebAdminPath %>assets/custom/js/role.js" type="text/javascript"></script>
</html>

